package org.ezplatform.office.questionnaire.entity;

import org.ezplatform.core.annotation.MetaData;
import org.ezplatform.core.entity.BaseNativeEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/** 
* @author 作者: wujs
* @version 创建时间：2017年12月6日 下午5:14:51 
* 类说明 
*/
@MetaData(value = "问卷管理")
@Entity(name = "QusetionnaireAnswerStatus")
@Table(name = "oa_qusetionnaire_answer_status", uniqueConstraints = { @UniqueConstraint(columnNames = "id") })
public class QusetionnaireAnswerStatus extends BaseNativeEntity{

	private static final long serialVersionUID = 8193857302082074130L;
	
	@MetaData(value = "问卷ID")
  	@Column(name = "questionnaire_id", nullable = false, length = 32)
    private String questionnaireId;
	
	@MetaData(value = "状态 0是未答卷、1是提交、2是草稿、4评卷")
  	@Column(name = "status", length = 10)
    private String status;

	@MetaData(value = "答卷人组织id")
	@Column(name = "org_id", length = 32)
	private String orgId;
	
	@MetaData(value = "回退原因")
	@Column(name = "back_reason", length = 800)
	private String backReason;
	
	@MetaData(value = "答卷成绩")
	@Column(name = "grade", length = 11)
	private float grade;
	
	@MetaData(value = "排名")
	@Column(name = "ranking", length = 11)
	private int ranking;
	
	@MetaData(value = "答题次数")
	@Column(name = "answer_num", length = 5)
	private int answerNum;
	
	/**
	 * 答卷状态
	 */
	public enum StatusEnum{
		/**
		 * 未答卷
		 */
	    NOANSWER("0","未答卷"),
		/**
		 * 提交
		 */
		SUBMIT("1","已提交"),
		/**
		 * 草稿
		 */
		DRAFT("2","草稿"),

		/**
		 * 已回退状态
		 */
		BACK("3","已回退"),
		
		/**
		 * 已评阅状态
		 */
		APPROVED("4","已评阅"),
		;
		private String code;
	    private String value;
	    StatusEnum(String code,String value){
			this.code = code;
			this.value =  value;
		}
		public String getCode() {
			return code;
		}
		public String getValue() {
			return value;
		}
	}

	public String getQuestionnaireId() {
		return questionnaireId;
	}

	public void setQuestionnaireId(String questionnaireId) {
		this.questionnaireId = questionnaireId;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getOrgId() {
		return orgId;
	}

	public void setOrgId(String orgId) {
		this.orgId = orgId;
	}

	public String getBackReason() {
		return backReason;
	}

	public void setBackReason(String backReason) {
		this.backReason = backReason;
	}

	public float getGrade() {
		return grade;
	}

	public void setGrade(float grade) {
		this.grade = grade;
	}

	public int getRanking() {
		return ranking;
	}

	public void setRanking(int ranking) {
		this.ranking = ranking;
	}

	public int getAnswerNum() {
		return answerNum;
	}

	public void setAnswerNum(int answerNum) {
		this.answerNum = answerNum;
	}
	
}
